<?php

use yii\helpers\Html;
//use yii\grid\GridView;
use yii\widgets\Pjax;
use kartik\grid\GridView;
/* @var $this yii\web\View */
/* @var $searchModel common\models\WarehouseSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */

$this->title = Yii::t('app', 'Warehouses');
$this->params['breadcrumbs'][] = $this->title;
?>
<link rel="stylesheet" href="/static/css/gridview.css">
<div class="warehouse-index">

    <?php  echo $this->render('_search', ['model' => $searchModel]); ?>
    <?php Pjax::begin(); ?>
    <?php // echo $this->render('_search', ['model' => $searchModel]); ?>

   
    <?= GridView::widget([
        'headerRowOptions' => ['class' => 'kartik-sheet-style'],
        'filterRowOptions' => ['class' => 'kartik-sheet-style'],
        'dataProvider' => $dataProvider,
       // 'filterModel' => $searchModel,
        'columns' => [
            'id',
            [
                'attribute' => 'company_name',
                'value' => 'company.company_name',
                'label' => '公司',
            ],
            'warehouse_name',
            'sort',
            [
                'label'=>'是否显示',
                'attribute' => 'is_display',
                'value' => function ($model) {
                $state = [
                    '0' => '不显示',
                    '1' => '显示',
                ];
                return $state[$model->is_display];
                },
            ],
            'remark',
            //'created_at',
            //'updated_at',

            ['class' => 'yii\grid\ActionColumn'],
        ],
    ]); ?>
    <?php Pjax::end(); ?>
</div>
